<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>个人Offer记录</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/sybida/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="/sybida/bs/bootstrap.min.css">
    <script src="/sybida/common/js/locahostadress.js" charset="utf-8"></script>
    <style>

        a{text-decoration: none}
        a:hover{text-decoration: none}
    </style>
</head>
<script src="/sybida/jquery/jquery-3.3.1.min.js"></script>

<body id="body" >
<br>



<div >
    <ol class="breadcrumb"style="border-bottom: #009688 1px solid;">
        <li class="active">个人Offer记录</li>
    </ol>
</div>
<div class="container">
    <br>
    <div class="layui-form-item">


        </select>

        <label  style="line-height: 35px; font-size: 16px;">每页大小:&nbsp;</label>
        <select class="form-control" id="pageSizeSel" style="width: 100px; display: inline-block" >
            <option name="pageSize" value="5">5条</option>
            <option name="pageSize" value="10">10条</option>
            <option name="pageSize" value="15">15条</option>
            <option name="pageSize" value="20">20条</option>
            <option name="pageSize" value="30">30条</option>
            <option name="pageSize" value="40">40条</option>
            <option name="pageSize" value="50">50条</option>
            <option name="pageSize" value="80">80条</option>
            <option name="pageSize" value="100">100条</option>

        </select>
        <!--<button type="button" id="selectButt" class="btn btn-success">&nbsp;查&nbsp;&nbsp;询&nbsp;</button>-->
        <button type="button" id="selectButt" class="layui-btn layui-btn-radius">&nbsp;查&nbsp;&nbsp;询&nbsp;</button>
        <button type="button" id="register" class="layui-btn layui-btn-radius layui-btn-warm" style="float: right"
                onclick="registerOffer()">&nbsp;Offer登记  </button>
    </div>

    <table class="table table-striped table-hover table-bordered">
        <tr class="active">
            <th style="width: 80px;"><input type="checkbox" name="checkAll">&nbsp;&nbsp;全选</th>
            <th>offer学习方向</th>
            <th>录用所在公司</th>
            <th>实习工资</th>
            <th>Offer须答复时间</th>
            <th>修改时间</th>
            <th>操作</th>
            <th>删除</th>
            <th>选择就业</th>
        </tr>
        <hr/>
    </table>

</div>
<div class="container" style="text-align: center">
    <nav aria-label="..." >
        <ul class="pagination" id="pagination">
        </ul>
    </nav>
</div>
<!--单个删除模态框-->
<div class="modal fade" style="margin-top:100px;padding-top:100px;" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">

            <div class="modal-body" style="margin-top: 20px;">
                <form>
                    <div class="form-group" >
                        <label id="messagetext" class="control-label">Message:</label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button"  class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" id="deleteOneSure" class="btn btn-primary">确定</button>
            </div>
        </div>
    </div>
</div>
<!--多个删除模态框-->
<div class="modal fade" id="exampleModalAll" style="margin-top:100px;padding-top:100px;" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"></span></button>
                <h4 class="modal-title" id="exampleModalLabel">删除</h4>
            </div>
            <div class="modal-body" style="margin-top: 20px;">
                <form>
                    <div class="form-group">
                        <label id="mm" class="control-label">确认将所选的全部个人offer记录删除？</label>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button"  id="canle" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" id="deleteAllSure" class="btn btn-primary">确认删除</button>
            </div>
        </div>
    </div>
</div>


<script src="/sybida/bs/bootstrap.min.js"></script>
<script src="/sybida/layui/layui.js"    ></script>
<script src="/sybida/student/js/studentPersonalOffer.js"></script>
<script src="/sybida/publicTool/js/dateutil.js"></script>



<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    var userid=getCookie("userid")
    var layer
    layui.use('layer', function(){
        layer = layui.layer;
    });
    $("#canle").click(function (){
        $("#exampleModalAll").attr("class","modal fade")
        $("#exampleModalAll").css("display","none")
    })
    $("#deleteAllSure").click(function (){

        var checkbox = $("input[name='optionAll']");
        var s=new Array();
        var j=0
        for(var i = 0;i<checkbox.length;i++)
        {
            if(checkbox[i].checked==true)
            {
                console.log(checkbox[i].value)
                s[j++]=(checkbox[i].value)
            }
        }
        if(s.length>0){
            $.post({
                url:url+"/offer/deleteAllStudentOffer",
                // 告知传递参数类型为json，不可缺少
                contentType:"application/json",
                data:JSON.stringify(s),
                beforeSend: function(request) {
                    request.setRequestHeader("token", userid);
                },
                success:function(data){
                    if(data== -1000){
                        location.href=logindexurl
                    }else{
                        if(data.code===1){
                            location.href="/sybida/student/studentPersonalOffer.html?pageNum=1&pageSize="+pageSize

                        }else{
                            layer.alert("删除失败请重试！");
                            $("#exampleModalAll").attr("class","modal fade")
                            $("#exampleModalAll").css("display","none")
                        }
                    }
                }
            })}else{
            layer.alert("所选数据为空！");
            $("#exampleModalAll").attr("class","modal fade")
            $("#exampleModalAll").css("display","none")
        }
    })
</script>



</body>
</html>

